﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Kernel
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Kernel
   ">
    <meta name="generator" content="docfx 2.56.4.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="CADability.Kernel">
  
  
  <h1 id="CADability_Kernel" data-uid="CADability.Kernel" class="text-break">Class Kernel
  </h1>
  <div class="markdown level0 summary"></div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">Kernel</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CADability.html">CADability</a></h6>
  <h6><strong>Assembly</strong>: CADability.dll</h6>
  <h5 id="CADability_Kernel_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class Kernel</code></pre>
  </div>
  <h3 id="methods">Methods
  </h3>
  
  
  <a id="CADability_Kernel_Beep_" data-uid="CADability.Kernel.Beep*"></a>
  <h4 id="CADability_Kernel_Beep_System_Int32_System_Int32_" data-uid="CADability.Kernel.Beep(System.Int32,System.Int32)">Beep(Int32, Int32)</h4>
  <div class="markdown level1 summary"><p>The <strong>Beep</strong> function generates simple tones on the speaker.  The function is
synchronous; it does not return control to its caller until the sound finishes.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool Beep(int frequency, int duration)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">frequency</span></td>
        <td><p>
    Frequency of the sound, in hertz.  This parameter must be in the range
    37 through 32,767 (0x25 through 0x7FFF).
</p>
<p>
<strong>Windows 95/98/Me:</strong>  The <strong>Beep</strong> function ignores this parameter.
</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">duration</span></td>
        <td><p>
    Duration of the sound, in milliseconds.
</p>
<p>
<strong>Windows 95/98/Me:</strong>  The <strong>Beep</strong> function ignores this parameter.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_Beep_System_Int32_System_Int32__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
<strong>Terminal Services:</strong>  The beep is redirected to the client.
</p>
<p>
<strong>Windows 95/98/Me:</strong>  On computers with a sound card, the function
plays the default sound event.  On computers without a sound card, the
function plays the standard system beep.
</p>
</div>
  
  
  <a id="CADability_Kernel_FreeLibrary_" data-uid="CADability.Kernel.FreeLibrary*"></a>
  <h4 id="CADability_Kernel_FreeLibrary_System_IntPtr_" data-uid="CADability.Kernel.FreeLibrary(System.IntPtr)">FreeLibrary(IntPtr)</h4>
  <div class="markdown level1 summary"><p>The <strong>FreeLibrary</strong> function decrements the reference count of the loaded
dynamic-link library (DLL).  When the reference count reaches zero, the module
is unmapped from the address space of the calling process and the handle is no
longer valid.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool FreeLibrary(IntPtr moduleHandle)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><span class="parametername">moduleHandle</span></td>
        <td><p>Handle to the loaded DLL module.  The <a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a> or
<a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetModuleHandle_System_String_">GetModuleHandle(String)</a> function returns this handle.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_FreeLibrary_System_IntPtr__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    Each process maintains a reference count for each loaded library module.  This
    reference count is incremented each time <a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a> is called
    and is decremented each time <strong>FreeLibrary</strong> is called.  A DLL module
    loaded at process initialization due to load-time dynamic linking has a
    reference count of one.  This count is incremented if the same module is
    loaded by a call to <a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a>.
</p>
<p>
    Before unmapping a library module, the system enables the DLL to detach from
    the process by calling the DLL&apos;s <strong>DllMain</strong> function, if it has one, with
    the DLL_PROCESS_DETACH value.  Doing so gives the DLL an opportunity to clean
    up resources allocated on behalf of the current process.  After the
    entry-point function returns, the library module is removed from the address
    space of the current process.
</p>
<p>
    It is not safe to call <strong>FreeLibrary</strong> from <strong>DllMain</strong>.  For more
    information, see the Remarks section in <strong>DllMain</strong>.
</p>
<p>
    Calling <strong>FreeLibrary</strong> does not affect other processes using the same
    library module.
</p>
</div>
  <h5 id="CADability_Kernel_FreeLibrary_System_IntPtr__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetModuleHandle_System_String_">GetModuleHandle(String)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetDllDirectory_" data-uid="CADability.Kernel.GetDllDirectory*"></a>
  <h4 id="CADability_Kernel_GetDllDirectory_System_Int32_System_Text_StringBuilder_" data-uid="CADability.Kernel.GetDllDirectory(System.Int32,System.Text.StringBuilder)">GetDllDirectory(Int32, StringBuilder)</h4>
  <div class="markdown level1 summary"><p>The <strong>GetDllDirectory</strong> function retrieves the application-specific portion of
the search path used to locate DLLs for the application.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int GetDllDirectory(int bufferLength, StringBuilder buffer)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">bufferLength</span></td>
        <td><p>Size of the output buffer, in characters.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Text.StringBuilder</span></td>
        <td><span class="parametername">buffer</span></td>
        <td><p>Pointer to a buffer that receives the application-specific portion of the search path.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>
    If the function succeeds, the return value is the length of the string copied
    to <em>buffer</em>, in characters, not including the terminating null character.
    If the return value is greater than <em>bufferLength</em>, it specifies the size
    of the buffer required for the path.
</p>
<p>
    If the function fails, the return value is zero.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetDllDirectory_System_Int32_System_Text_StringBuilder__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_SetDllDirectory_System_String_">SetDllDirectory(String)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetModuleFileName_" data-uid="CADability.Kernel.GetModuleFileName*"></a>
  <h4 id="CADability_Kernel_GetModuleFileName_System_IntPtr_System_Text_StringBuilder_System_Int32_" data-uid="CADability.Kernel.GetModuleFileName(System.IntPtr,System.Text.StringBuilder,System.Int32)">GetModuleFileName(IntPtr, StringBuilder, Int32)</h4>
  <div class="markdown level1 summary"><p>
    The <strong>GetModuleFileName</strong> function retrieves the fully qualified path for
    the specified module.
</p>
<p>
    To specify the process that contains the module, use the
<strong>GetModuleFileNameEx</strong> function.
</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int GetModuleFileName(IntPtr module, StringBuilder fileName, int size)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><span class="parametername">module</span></td>
        <td><p>Handle to the module whose path is being requested.  If this parameter is NULL,
<strong>GetModuleFileName</strong> retrieves the path for the current module.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Text.StringBuilder</span></td>
        <td><span class="parametername">fileName</span></td>
        <td><p>
    Pointer to a buffer that receives a null-terminated string that specifies the
    fully-qualified path of the module.  If the length of the path exceeds the
    size specified by the <em>size</em> parameter, the function succeeds and the
    string is truncated to <em>size</em> characters and null terminated.
</p>
<p>
    The path can have the prefix &quot;\\?\&quot;, depending on how the module was loaded.
</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">size</span></td>
        <td><p>Size of the <em>filename</em> buffer, in TCHARs.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>
    If the function succeeds, the return value is the length of the string copied
    to the buffer, in TCHARs.  If the buffer is too small to hold the module name,
    the string is truncated to <em>size</em>, and the function returns <em>size</em>.
</p>
<p>
    If the function fails, the return value is zero.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetModuleFileName_System_IntPtr_System_Text_StringBuilder_System_Int32__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    If a DLL is loaded in two processes, its file name in one process may differ
    in case from its file name in the other process.
</p>
<p>
    For the ANSI version of the function, the number of TCHARs is the number of
    bytes; for the Unicode version, it is the number of characters.
</p>
<p>
<strong>Windows Me/98/95:</strong>  This function retrieves long file names when an
application&apos;s version number is greater than or equal to 4.00 and the long
file name is available.  Otherwise, it returns only 8.3 format file names.
</p>
</div>
  <h5 id="CADability_Kernel_GetModuleFileName_System_IntPtr_System_Text_StringBuilder_System_Int32__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetModuleHandle_System_String_">GetModuleHandle(String)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetModuleHandle_" data-uid="CADability.Kernel.GetModuleHandle*"></a>
  <h4 id="CADability_Kernel_GetModuleHandle_System_String_" data-uid="CADability.Kernel.GetModuleHandle(System.String)">GetModuleHandle(String)</h4>
  <div class="markdown level1 summary"><p>
    The <strong>GetModuleHandle</strong> function retrieves a module handle for the
    specified module if the file has been mapped into the address space of the
    calling process.
</p>
<p>
    To avoid the race conditions described in the Remarks section, use the
<strong>GetModuleHandleEx</strong> function.
</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static IntPtr GetModuleHandle(string moduleName)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">moduleName</span></td>
        <td><p>
    Pointer to a null-terminated string that contains the name of the module
    (either a .dll or .exe file).  If the file name extension is omitted, the
    default library extension .dll is appended.  The file name string can include
    a trailing point character (.) to indicate that the module name has no
    extension.  The string does not have to specify a path.  When specifying a
    path, be sure to use backslashes (\), not forward slashes (/).  The name is
    compared (case independently) to the names of modules currently mapped into
    the address space of the calling process.
</p>
<p>
    If this parameter is NULL, <strong>GetModuleHandle</strong> returns a handle to the
    file used to create the calling process.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><p>
    If the function succeeds, the return value is a handle to the specified module
    (IntPtr).
</p>
<p>
    If the function fails, the return value is NULL (IntPtr.Zero).  To get
    extended error information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetModuleHandle_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    The returned handle is not global or inheritable.  It cannot be duplicated
    or used by another process.
</p>
<p>
    The <strong>GetModuleHandle</strong> function returns a handle to a mapped module
    without incrementing its reference count.  Therefore, use care when passing
    the handle to the <a class="xref" href="CADability.Kernel.html#CADability_Kernel_FreeLibrary_System_IntPtr_">FreeLibrary(IntPtr)</a> function, because doing so can
    cause a DLL module to be unmapped prematurely.
</p>
<p>
    This function must be used carefully in a multithreaded application.  There
    is no guarantee that the module handle remains valid between the time this
    function returns the handle and the time it is used.  For example, a thread
    retrieves a module handle, but before it uses the handle, a second thread
    frees the module.  If the system loads another module, it could reuse the
    module handle that was recently freed.  Therefore, first thread would have
    a handle to a module different than the one intended.
</p>
</div>
  <h5 id="CADability_Kernel_GetModuleHandle_System_String__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_FreeLibrary_System_IntPtr_">FreeLibrary(IntPtr)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetModuleFileName_System_IntPtr_System_Text_StringBuilder_System_Int32_">GetModuleFileName(IntPtr, StringBuilder, Int32)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetProcAddress_" data-uid="CADability.Kernel.GetProcAddress*"></a>
  <h4 id="CADability_Kernel_GetProcAddress_System_IntPtr_System_String_" data-uid="CADability.Kernel.GetProcAddress(System.IntPtr,System.String)">GetProcAddress(IntPtr, String)</h4>
  <div class="markdown level1 summary"><p>The <strong>GetProcAddress</strong> function retrieves the address of an exported function
or variable from the specified dynamic-link library (DLL).</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static IntPtr GetProcAddress(IntPtr module, string processName)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><span class="parametername">module</span></td>
        <td><p>Handle to the DLL module that contains the function or variable.  The
<a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a> or <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetModuleHandle_System_String_">GetModuleHandle(String)</a> function returns
this handle.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">processName</span></td>
        <td><p>Pointer to a null-terminated string that specifies the function or variable name,
or the function's ordinal value.  If this parameter is an ordinal value, it must
be in the low-order word; the high-order word must be zero.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><p>
    If the function succeeds, the return value is the address of the exported
    function or variable.
</p>
<p>
    If the function fails, the return value is NULL (IntPtr.Zero).  To get
    extended error information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetProcAddress_System_IntPtr_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    The spelling and case of a function name pointed to by <em>processName</em> must
    be identical to that in the EXPORTS statement of the source DLL&apos;s
    module-definition (.def) file.  The exported names of functions may differ
    from the names you use when calling these functions in your code.  This
    difference is hidden by macros used in the SDK header files.
</p>
<p>
    The <em>processName</em> parameter can identify the DLL function by specifying
    an ordinal value associated with the function in the EXPORTS statement.
<strong>GetProcAddress</strong> verifies that the specified ordinal is in the range 1
through the highest ordinal value exported in the .def file.  The function
then uses the ordinal as an index to read the function&apos;s address from a
function table.  If the .def file does not number the functions consecutively
from 1 to N (where N is the number of exported functions), an error can occur
where <strong>GetProcAddress</strong> returns an invalid, non-NULL address, even though
there is no function with the specified ordinal.
</p>
<p>
    In cases where the function may not exist, the function should be specified by
    name rather than by ordinal value.
</p>
</div>
  <h5 id="CADability_Kernel_GetProcAddress_System_IntPtr_System_String__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_FreeLibrary_System_IntPtr_">FreeLibrary(IntPtr)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetModuleHandle_System_String_">GetModuleHandle(String)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetProcessWorkingSetSize_" data-uid="CADability.Kernel.GetProcessWorkingSetSize*"></a>
  <h4 id="CADability_Kernel_GetProcessWorkingSetSize_System_IntPtr_System_Int32__System_Int32__" data-uid="CADability.Kernel.GetProcessWorkingSetSize(System.IntPtr,System.Int32@,System.Int32@)">GetProcessWorkingSetSize(IntPtr, out Int32, out Int32)</h4>
  <div class="markdown level1 summary"><p>The <strong>GetProcessWorkingSetSize</strong> function retrieves the minimum and maximum
working set sizes of the specified process.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool GetProcessWorkingSetSize(IntPtr process, out int minimumWorkingSetSize, out int maximumWorkingSetSize)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><span class="parametername">process</span></td>
        <td><p>Handle to the process whose working set sizes will be obtained.  The handle must
have the PROCESS_QUERY_INFORMATION access right.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">minimumWorkingSetSize</span></td>
        <td><p>Pointer to a variable that receives the minimum working set size of the specified
process, in bytes.  The virtual memory manager attempts to keep at least this much
memory resident in the process whenever the process is active.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">maximumWorkingSetSize</span></td>
        <td><p>Pointer to a variable that receives the maximum working set size of the specified
process, in bytes.  The virtual memory manager attempts to keep no more than this
much memory resident in the process whenever the process is active when memory is
in short supply.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetProcessWorkingSetSize_System_IntPtr_System_Int32__System_Int32___remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>The &quot;working set&quot; of a process is the set of memory pages currently visible to
the process in physical RAM memory.  These pages are resident and available for
an application to use without triggering a page fault.  The minimum and maximum
working set sizes affect the virtual memory paging behavior of a process.</p>
</div>
  <h5 id="CADability_Kernel_GetProcessWorkingSetSize_System_IntPtr_System_Int32__System_Int32___seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_SetProcessWorkingSetSize_System_IntPtr_System_Int32_System_Int32_">SetProcessWorkingSetSize(IntPtr, Int32, Int32)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetSystemDirectory_" data-uid="CADability.Kernel.GetSystemDirectory*"></a>
  <h4 id="CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_" data-uid="CADability.Kernel.GetSystemDirectory(System.Text.StringBuilder,System.Int32)">GetSystemDirectory(StringBuilder, Int32)</h4>
  <div class="markdown level1 summary"><p>
    The <strong>GetSystemDirectory</strong> function retrieves the path of the system
    directory.  The system directory contains system such files such as
    dynamic-link libraries, drivers, and font files.
</p>
<p>
    This function is provided primarily for compatibility.  Applications should
    store code in the Program Files folder and persistent data in the Application
    Data folder in the user&apos;s profile.
</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int GetSystemDirectory(StringBuilder buffer, int size)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Text.StringBuilder</span></td>
        <td><span class="parametername">buffer</span></td>
        <td><p>Pointer to the buffer to receive the null-terminated string containing the path.
This path does not end with a backslash unless the system directory is the root
directory.  For example, if the system directory is named Windows\System on drive
C, the path of the system directory retrieved by this function is
C:\Windows\System.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">size</span></td>
        <td><p>Maximum size of the buffer, in TCHARs.  This value should be set to at least
MAX_PATH+1 to allow sufficient space for the path and the null terminator.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>
    If the function succeeds, the return value is the length, in TCHARs, of the
    string copied to the buffer, not including the terminating null character.  If
    the length is greater than the size of the buffer, the return value is the
    size of the buffer required to hold the path.
</p>
<p>
    If the function fails, the return value is zero.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>Applications should not create files in the system directory.  If the user is
running a shared version of the operating system, the application does not have
write access to the system directory.</p>
</div>
  <h5 id="CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetSystemInfo_" data-uid="CADability.Kernel.GetSystemInfo*"></a>
  <h4 id="CADability_Kernel_GetSystemInfo_CADability_Kernel_SYSTEM_INFO__" data-uid="CADability.Kernel.GetSystemInfo(CADability.Kernel.SYSTEM_INFO@)">GetSystemInfo(out Kernel.SYSTEM_INFO)</h4>
  <div class="markdown level1 summary"><p>
    The <strong>GetSystemInfo</strong> function returns information about the current
    system.
</p>
<p>
    To retrieve accurate information for a Win32-based application running on
    WOW64, call the <strong>GetNativeSystemInfo</strong> function.
</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void GetSystemInfo(out Kernel.SYSTEM_INFO systemInfo)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CADability.Kernel.SYSTEM_INFO.html">Kernel.SYSTEM_INFO</a></td>
        <td><span class="parametername">systemInfo</span></td>
        <td><p>Pointer to a <a class="xref" href="CADability.Kernel.SYSTEM_INFO.html">Kernel.SYSTEM_INFO</a> structure that receives the information.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetSystemInfo_CADability_Kernel_SYSTEM_INFO___seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.SYSTEM_INFO.html">Kernel.SYSTEM_INFO</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetSystemWindowsDirectory_" data-uid="CADability.Kernel.GetSystemWindowsDirectory*"></a>
  <h4 id="CADability_Kernel_GetSystemWindowsDirectory_System_Text_StringBuilder_System_Int32_" data-uid="CADability.Kernel.GetSystemWindowsDirectory(System.Text.StringBuilder,System.Int32)">GetSystemWindowsDirectory(StringBuilder, Int32)</h4>
  <div class="markdown level1 summary"><p>The <strong>GetSystemWindowsDirectory</strong> function retrieves the path of the shared
Windows directory on a multi-user system.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int GetSystemWindowsDirectory(StringBuilder buffer, int size)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Text.StringBuilder</span></td>
        <td><span class="parametername">buffer</span></td>
        <td><p>Pointer to the buffer to receive a null-terminated string containing the path.
This path does not end with a backslash unless the Windows directory is the root
directory.  For example, if the Windows directory is named Windows on drive C,
the path of the Windows directory retrieved by this function is C:\Windows.  If
the system was installed in the root directory of drive C, the path retrieved
is C:.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">size</span></td>
        <td><p>Maximum size of the buffer specified by the <em>buffer</em> parameter, in TCHARs.
This value should be set to at least MAX_PATH+1 to allow sufficient space for the
path and the null-terminating character.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>
    If the function succeeds, the return value is the length of the string copied
    to the buffer, in TCHARs, not including the terminating null character.
</p>
<p>
    If the length is greater than the size of the buffer, the return value is the
    size of the buffer required to hold the path.
</p>
<p>
    If the function fails, the return value is zero.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetSystemWindowsDirectory_System_Text_StringBuilder_System_Int32__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    On a system that is running Terminal Server, each user has a unique Windows
    directory.  The system Windows directory is shared by all users, so it is the
    directory where an application should store initialization and help files that
    apply to all users.
</p>
<p>
    With Terminal Services, the <strong>GetSystemWindowsDirectory</strong> function
    retrieves the path of the system Windows directory, while the
<a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a> function retrieves the path of a Windows
directory that is private for each user.  On a single-user system,
<strong>GetSystemWindowsDirectory</strong> is the same as
<a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a>.
</p>
<p>
<strong>Windows NT 4.0 Terminal Server Edition:</strong>  To retrieve the shared
Windows directory, call <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_">GetSystemDirectory(StringBuilder, Int32)</a> and trim the
&quot;System32&quot; element from the end of the returned path.
</p>
</div>
  <h5 id="CADability_Kernel_GetSystemWindowsDirectory_System_Text_StringBuilder_System_Int32__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GetTickCount_" data-uid="CADability.Kernel.GetTickCount*"></a>
  <h4 id="CADability_Kernel_GetTickCount" data-uid="CADability.Kernel.GetTickCount">GetTickCount()</h4>
  <div class="markdown level1 summary"><p>The <strong>GetTickCount</strong> function retrieves the number of milliseconds that have
elapsed since the system was started.  It is limited to the resolution of the
system timer.  To obtain the system timer resolution, use the
<strong>GetSystemTimeAdjustment</strong> function.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int GetTickCount()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>The return value is the number of milliseconds that have elapsed since the system
was started.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetTickCount_remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    The elapsed time is stored as a DWORD value.  Therefore, the time will wrap
    around to zero if the system is run continuously for 49.7 days.
</p>
<p>
    If you need a higher resolution timer, use a multimedia timer or a
    high-resolution timer.
</p>
<p>
    To obtain the time elapsed since the computer was started, retrieve the System
    Up Time counter in the performance data in the registry key
    HKEY_PERFORMANCE_DATA.  The value returned is an 8-byte value.
</p>
</div>
  
  
  <a id="CADability_Kernel_GetWindowsDirectory_" data-uid="CADability.Kernel.GetWindowsDirectory*"></a>
  <h4 id="CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_" data-uid="CADability.Kernel.GetWindowsDirectory(System.Text.StringBuilder,System.Int32)">GetWindowsDirectory(StringBuilder, Int32)</h4>
  <div class="markdown level1 summary"><p>
    The <strong>GetWindowsDirectory</strong> function retrieves the path of the Windows
    directory.  The Windows directory contains such files as applications,
    initialization files, and help files.
</p>
<p>
    This function is provided primarily for compatibility.  Applications should
    store code in the Program Files folder and persistent data in the Application
    Data folder in the user&apos;s profile.
</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int GetWindowsDirectory(StringBuilder buffer, int size)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Text.StringBuilder</span></td>
        <td><span class="parametername">buffer</span></td>
        <td><p>Pointer to the buffer to receive the null-terminated string containing the path.
This path does not end with a backslash unless the Windows directory is the root
directory.  For example, if the Windows directory is named Windows on drive C, the
path of the Windows directory retrieved by this function is C:\Windows.  If the
system was installed in the root directory of drive C, the path retrieved is C:.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">size</span></td>
        <td><p>Maximum size of the buffer specified by the <em>buffer</em> parameter, in TCHARs.
This value should be set to MAX_PATH.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>
    If the function succeeds, the return value is the length of the string copied
    to the buffer, in TCHARs, not including the terminating null character.
</p>
<p>
    If the length is greater than the size of the buffer, the return value is the
    size of the buffer required to hold the path.
</p>
<p>
    If the function fails, the return value is zero.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    The Windows directory is the directory where an application should store
    initialization and help files. If the user is running a shared version of the
    system, the Windows directory is guaranteed to be private for each user.
</p>
<p>
    If an application creates other files that it wants to store on a per-user
    basis, it should place them in the directory specified by the HOMEPATH
    environment variable.  This directory will be different for each user, if so
    specified by an administrator, through the User Manager administrative tool.
    HOMEPATH always specifies either the user&apos;s home directory, which is
    guaranteed to be private for each user, or a default directory (for example,
    C:\USERS\DEFAULT) where the user will have all access.
</p>
<p>
<strong>Terminal Services:</strong>  If the application is running in a Terminal
Services environment, each user has a unique Windows directory.  If an
application that is not Terminal-Services-aware calls this function, it
retrieves the path of the Windows directory on the client, not the Windows
directory on the server.
</p>
</div>
  <h5 id="CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_">GetSystemDirectory(StringBuilder, Int32)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetSystemWindowsDirectory(StringBuilder, Int32)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_GlobalMemoryStatus_" data-uid="CADability.Kernel.GlobalMemoryStatus*"></a>
  <h4 id="CADability_Kernel_GlobalMemoryStatus_CADability_Kernel_MEMORYSTATUS__" data-uid="CADability.Kernel.GlobalMemoryStatus(CADability.Kernel.MEMORYSTATUS@)">GlobalMemoryStatus(out Kernel.MEMORYSTATUS)</h4>
  <div class="markdown level1 summary"><p>
    The <strong>GlobalMemoryStatus</strong> function obtains information about the system&apos;s
    current usage of both physical and virtual memory.
</p>
<p>
    To obtain information about the extended portion of the virtual address space,
    or if your application may run on computers with more than 4 GB of main
    memory, use the <strong>GlobalMemoryStatusEx</strong> function.
</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void GlobalMemoryStatus(out Kernel.MEMORYSTATUS buffer)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CADability.Kernel.MEMORYSTATUS.html">Kernel.MEMORYSTATUS</a></td>
        <td><span class="parametername">buffer</span></td>
        <td><p>Pointer to a <a class="xref" href="CADability.Kernel.MEMORYSTATUS.html">Kernel.MEMORYSTATUS</a> structure.  The <strong>GlobalMemoryStatus</strong>
function stores information about current memory availability into this structure.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_GlobalMemoryStatus_CADability_Kernel_MEMORYSTATUS___remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    You can use the <strong>GlobalMemoryStatus</strong> function to determine how much
    memory your application can allocate without severely impacting other
    applications.
</p>
<p>
    The information returned by the <strong>GlobalMemoryStatus</strong> function is
    volatile.  There is no guarantee that two sequential calls to this function
    will return the same information.
</p>
<p>
    On computers with more than 4 GB of memory, the <strong>GlobalMemoryStatus</strong>
    function can return incorrect information.  Windows 2000 and later report a
    value of -1 to indicate an overflow.  Earlier versions of Windows NT report a
    value that is the real amount of memory, modulo 4 GB.  For this reason, use
    the <strong>GlobalMemoryStatusEx</strong> function instead.
</p>
<p>
    On Intel x86 computers with more than 2 GB and less than 4 GB of memory, the
<strong>GlobalMemoryStatus</strong> function will always return 2 GB in the
<a class="xref" href="CADability.Kernel.MEMORYSTATUS.html#CADability_Kernel_MEMORYSTATUS_TotalPhys">TotalPhys</a> member of the
<a class="xref" href="CADability.Kernel.MEMORYSTATUS.html">Kernel.MEMORYSTATUS</a> structure.  Similarly, if the total available
memory is between 2 and 4 GB, the <a class="xref" href="CADability.Kernel.MEMORYSTATUS.html#CADability_Kernel_MEMORYSTATUS_AvailPhys">AvailPhys</a> member
of the <a class="xref" href="CADability.Kernel.MEMORYSTATUS.html">Kernel.MEMORYSTATUS</a> structure will be rounded down to 2 GB.  If
the executable is linked using the /LARGEADDRESSWARE linker option, then the
<strong>GlobalMemoryStatus</strong> function will return the correct amount of physical
memory in both members.
</p>
</div>
  <h5 id="CADability_Kernel_GlobalMemoryStatus_CADability_Kernel_MEMORYSTATUS___seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.MEMORYSTATUS.html">Kernel.MEMORYSTATUS</a></div>
  </div>
  
  
  <a id="CADability_Kernel_IsProcessorFeaturePresent_" data-uid="CADability.Kernel.IsProcessorFeaturePresent*"></a>
  <h4 id="CADability_Kernel_IsProcessorFeaturePresent_System_Int32_" data-uid="CADability.Kernel.IsProcessorFeaturePresent(System.Int32)">IsProcessorFeaturePresent(Int32)</h4>
  <div class="markdown level1 summary"><p>The <strong>IsProcessorFeaturePresent</strong> function determines whether the specified
processor feature is supported by the current computer.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool IsProcessorFeaturePresent(int processorFeature)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">processorFeature</span></td>
        <td><p>
    Processor feature to be tested.  This parameter can be one of the following
    values:
</p>
<p>
<table><thead><tr><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><see cref="!:WinNt.PF_3DNOW_INSTRUCTIONS_AVAILABLE"></see></td><td>
            The 3D-Now instruction set is available.
</td></tr><tr><td><see cref="!:WinNt.PF_COMPARE_EXCHANGE_DOUBLE"></see></td><td>
    The compare and exchange double operation is available (Pentium,
    MIPS, and Alpha).
</td></tr><tr><td><see cref="!:WinNt.PF_FLOATING_POINT_EMULATED"></see></td><td>
<p>
    Floating-point operations are emulated using a software
    emulator.
</p>
<p>
    This function returns true if floating-point operations are
    emulated; otherwise, it returns false.
</p>
<p>
<strong>Windows NT 4.0:</strong>  This function returns false if
floating-point operations are emulated; otherwise, it returns
true.  This behavior is a bug that is fixed in later versions.
</p>
</td></tr><tr><td><see cref="!:WinNt.PF_FLOATING_POINT_PRECISION_ERRATA"></see></td><td>
<strong>Pentium:</strong>  In rare circumstances, a floating-point precision
error can occur.
</td></tr><tr><td><see cref="!:WinNt.PF_MMX_INSTRUCTIONS_AVAILABLE"></see></td><td>
    The MMX instruction set is available.
</td></tr><tr><td><see cref="!:WinNt.PF_PAE_ENABLED"></see></td><td>
    The processor is PAE-enabled.
</td></tr><tr><td><see cref="!:WinNt.PF_RDTSC_INSTRUCTION_AVAILABLE"></see></td><td>
    The RDTSC instruction is available.
</td></tr><tr><td><see cref="!:WinNt.PF_XMMI_INSTRUCTIONS_AVAILABLE"></see></td><td>
    The SSE instruction set is available.
</td></tr><tr><td><see cref="!:WinNt.PF_XMMI64_INSTRUCTIONS_AVAILABLE"></see></td><td>
    The SSE2 instruction set is available.
</td></tr></tbody></table>
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the feature is supported, the return value is true.
</p>
<p>
    If the feature is not supported, the return value is false.
</p>
</td>
      </tr>
    </tbody>
  </table>
  
  
  <a id="CADability_Kernel_LoadLibrary_" data-uid="CADability.Kernel.LoadLibrary*"></a>
  <h4 id="CADability_Kernel_LoadLibrary_System_String_" data-uid="CADability.Kernel.LoadLibrary(System.String)">LoadLibrary(String)</h4>
  <div class="markdown level1 summary"><p>The <strong>LoadLibrary</strong> function maps the specified executable module into the
address space of the calling process.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static IntPtr LoadLibrary(string fileName)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">fileName</span></td>
        <td><p>
    Pointer to a null-terminated string that names the executable module (either
    a .dll or .exe file).  The name specified is the file name of the module and
    is not related to the name stored in the library module itself, as specified
    by the LIBRARY keyword in the module-definition (.def) file.
</p>
<p>
    If the string specifies a path but the file does not exist in the specified
    directory, the function fails.  When specifying a path, be sure to use
    backslashes (\), not forward slashes (/).
</p>
<p>
    If the string does not specify a path, the function uses a standard search
    strategy to find the file.  See the Remarks for more information.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><p>
    If the function succeeds, the return value is a handle to the module (IntPtr).
</p>
<p>
    If the function fails, the return value is NULL (IntPtr.Zero).  To get
    extended error information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
<p>
<strong>Windows Me/98/95:</strong>  If you are using <strong>LoadLibrary</strong> to load a module
that contains a resource whose numeric identifier is greater than 0x7FFF,
<strong>LoadLibrary</strong> fails.  If you are attempting to load a 16-bit DLL directly
from 32-bit code, <strong>LoadLibrary</strong> fails.  If you are attempting to load a
DLL whose subsystem version is greater than 4.0, <strong>LoadLibrary</strong> fails.  If
your <strong>DllMain</strong> function tries to call the Unicode version of a function,
<strong>LoadLibrary</strong> fails.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_LoadLibrary_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
<strong>LoadLibrary</strong> can be used to map a DLL module and return a handle that
can be used in <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetProcAddress_System_IntPtr_System_String_">GetProcAddress(IntPtr, String)</a> to get the address of a DLL
function.  <strong>LoadLibrary</strong> can also be used to map other executable
modules.  For example, the function can specify an .exe file to get a
handle that can be used in <strong>FindResource</strong> or <strong>LoadResource</strong>.
However, do not use <strong>LoadLibrary</strong> to run an .exe file, use the
<strong>CreateProcess</strong> function.
</p>
<p>
    If the module is a DLL not already mapped for the calling process, the system
    calls the DLL&apos;s <strong>DllMain</strong> function with the DLL_PROCESS_ATTACH value.  If
    the DLL&apos;s entry-point function does not return TRUE, <strong>LoadLibrary</strong> fails
    and returns NULL.  (The system immediately calls your entry-point function
    with DLL_PROCESS_DETACH and unloads the DLL.)
</p>
<p>
    It is not safe to call <strong>LoadLibrary</strong> from <strong>DllMain</strong>.  For more
    information, see the Remarks section in <strong>DllMain</strong>.
</p>
<p>
    Module handles are not global or inheritable.  A call to <strong>LoadLibrary</strong> by
    one process does not produce a handle that another process can use — for
    example, in calling <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetProcAddress_System_IntPtr_System_String_">GetProcAddress(IntPtr, String)</a>.  The other process must
    make its own call to <strong>LoadLibrary</strong> for the module before calling
<a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetProcAddress_System_IntPtr_System_String_">GetProcAddress(IntPtr, String)</a>.
</p>
<p>
    If no file name extension is specified in the <em>fileName</em> parameter, the
    default library extension .dll is appended.  However, the file name string
    can include a trailing point character (.) to indicate that the module name
    has no extension.  When no path is specified, the function searches for loaded
    modules whose base name matches the base name of the module to be loaded.  If
    the name matches, the load succeeds.  Otherwise, the function searches for the
    file in the following sequence:
</p>
<p>
<ol><li>
            The directory from which the application loaded.
</li><li>
    The current directory.
</li><li>
    The system directory.  Use the <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_">GetSystemDirectory(StringBuilder, Int32)</a>
    function to get the path of this directory.
</li><li>
<p>
    The 16-bit system directory.  There is no function that
    obtains the path of this directory, but it is searched.
</p>
<p>
<strong>Windows Me/98/95:</strong>  This directory does not exist.
</p>
</li><li>
    The Windows directory.  Use the <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a>
    function to get the path of this directory.
</li><li>
    The directories that are listed in the PATH environment variable.
</li></ol>
</p>
<p>
<strong>Windows Server 2003, Windows XP SP1:</strong>  The default value of
HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1
(current directory is searched after the system and Windows directories).
</p>
<p>
<strong>Windows XP:</strong>  If
HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode is 1,
the current directory is searched after the system and Windows directories,
but before the directories in the PATH environment variable.  The default
value is 0 (current directory is searched before the system and Windows
directories).
</p>
<p>
    The first directory searched is the one directory containing the image file
    used to create the calling process (for more information, see the
<strong>CreateProcess</strong> function).  Doing this allows private dynamic-link
library (DLL) files associated with a process to be found without adding the
process&apos;s installed directory to the PATH environment variable.
</p>
<p>
    The search path can be altered using the <a class="xref" href="CADability.Kernel.html#CADability_Kernel_SetDllDirectory_System_String_">SetDllDirectory(String)</a>
    function.  This solution is recommended instead of using
<strong>SetCurrentDirectory</strong> or hard-coding the full path to the DLL.
</p>
<p>
    If a path is specified and there is a redirection file for the application,
    the function searches for the module in the application&apos;s directory.  If the
    module exists in the application&apos;s directory, the <strong>LoadLibrary</strong> function
    ignores the specified path and loads the module from the application&apos;s
    directory.  If the module does not exist in the application&apos;s directory,
<strong>LoadLibrary</strong> loads the module from the specified directory.
</p>
</div>
  <h5 id="CADability_Kernel_LoadLibrary_System_String__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_FreeLibrary_System_IntPtr_">FreeLibrary(IntPtr)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetProcAddress_System_IntPtr_System_String_">GetProcAddress(IntPtr, String)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_">GetSystemDirectory(StringBuilder, Int32)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_SetDllDirectory_System_String_">SetDllDirectory(String)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_QueryPerformanceCounter_" data-uid="CADability.Kernel.QueryPerformanceCounter*"></a>
  <h4 id="CADability_Kernel_QueryPerformanceCounter_System_Int64__" data-uid="CADability.Kernel.QueryPerformanceCounter(System.Int64@)">QueryPerformanceCounter(out Int64)</h4>
  <div class="markdown level1 summary"><p>The <strong>QueryPerformanceCounter</strong> function retrieves the current value of the
high-resolution performance counter.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool QueryPerformanceCounter(out long performanceCount)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int64</span></td>
        <td><span class="parametername">performanceCount</span></td>
        <td><p>Pointer to a variable that receives the current performance-counter value, in
counts.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_QueryPerformanceCounter_System_Int64___remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>On a multiprocessor machine, it should not matter which processor is called.
However, you can get different results on different processors due to bugs in the
BIOS or the HAL.  To specify processor affinity for a thread, use the
<strong>SetThreadAffinityMask</strong> function.</p>
</div>
  <h5 id="CADability_Kernel_QueryPerformanceCounter_System_Int64___seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_QueryPerformanceCounterFast_System_Int64__">QueryPerformanceCounterFast(out Int64)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_QueryPerformanceFrequency_System_Int64__">QueryPerformanceFrequency(out Int64)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_QueryPerformanceCounterFast_" data-uid="CADability.Kernel.QueryPerformanceCounterFast*"></a>
  <h4 id="CADability_Kernel_QueryPerformanceCounterFast_System_Int64__" data-uid="CADability.Kernel.QueryPerformanceCounterFast(System.Int64@)">QueryPerformanceCounterFast(out Int64)</h4>
  <div class="markdown level1 summary"><p>The <strong>QueryPerformanceCounterFast</strong> function retrieves the current value of the
high-resolution performance counter.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static int QueryPerformanceCounterFast(out long performanceCount)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int64</span></td>
        <td><span class="parametername">performanceCount</span></td>
        <td><p>Pointer to a variable that receives the current performance-counter value, in
counts.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_QueryPerformanceCounterFast_System_Int64___remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    This version of <a class="xref" href="CADability.Kernel.html#CADability_Kernel_QueryPerformanceCounter_System_Int64__">QueryPerformanceCounter(out Int64)</a> is slightly faster.  It
    does not set the last Windows error.  Use with care.
</p>
<p>
    On a multiprocessor machine, it should not matter which processor is called.
    However, you can get different results on different processors due to bugs in
    the BIOS or the HAL.  To specify processor affinity for a thread, use the
<strong>SetThreadAffinityMask</strong> function.
</p>
</div>
  <h5 id="CADability_Kernel_QueryPerformanceCounterFast_System_Int64___seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_QueryPerformanceCounter_System_Int64__">QueryPerformanceCounter(out Int64)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_QueryPerformanceFrequency_System_Int64__">QueryPerformanceFrequency(out Int64)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_QueryPerformanceFrequency_" data-uid="CADability.Kernel.QueryPerformanceFrequency*"></a>
  <h4 id="CADability_Kernel_QueryPerformanceFrequency_System_Int64__" data-uid="CADability.Kernel.QueryPerformanceFrequency(System.Int64@)">QueryPerformanceFrequency(out Int64)</h4>
  <div class="markdown level1 summary"><p>The <strong>QueryPerformanceFrequency</strong> function retrieves the frequency of the
high-resolution performance counter, if one exists.  The frequency cannot change
while the system is running.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool QueryPerformanceFrequency(out long frequency)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int64</span></td>
        <td><span class="parametername">frequency</span></td>
        <td><p>Pointer to a variable that receives the current performance-counter frequency, in
counts per second.  If the installed hardware does not support a high-resolution
performance counter, this parameter can be zero.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the installed hardware supports a high-resolution performance counter, the
    return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.  For example, if
    the installed hardware does not support a high-resolution performance counter,
    the function fails.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_QueryPerformanceFrequency_System_Int64___remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p><strong>Note</strong>  The frequency of the high-resolution performance counter is not the
processor speed.</p>
</div>
  <h5 id="CADability_Kernel_QueryPerformanceFrequency_System_Int64___seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_QueryPerformanceCounter_System_Int64__">QueryPerformanceCounter(out Int64)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_SetDllDirectory_" data-uid="CADability.Kernel.SetDllDirectory*"></a>
  <h4 id="CADability_Kernel_SetDllDirectory_System_String_" data-uid="CADability.Kernel.SetDllDirectory(System.String)">SetDllDirectory(String)</h4>
  <div class="markdown level1 summary"><p>The <strong>SetDllDirectory</strong> function modifies the search path used to locate DLLs
for the application.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool SetDllDirectory(string pathName)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><span class="parametername">pathName</span></td>
        <td><p>Pointer to a null-terminated string that specifies the directories to be added to
the search path, separated by semicolons.  If this parameter is NULL, the default
search path is used.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_SetDllDirectory_System_String__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    The <strong>SetDllDirectory</strong> function affects all subsequent calls to the
<a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a> and <strong>LoadLibraryEx</strong> functions.  After calling
<strong>SetDllDirectory</strong>, the DLL search path is:
</p>
<p>
<ol><li>
            The directory from which the application loaded.
</li><li>
    The directory specified by the <em>pathName</em> parameter.
</li><li>
    The system directory.  Use the <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_">GetSystemDirectory(StringBuilder, Int32)</a>
    function to get the path of this directory.  The name of this
    directory is System32.
</li><li>
    The 16-bit system directory.  There is no function that obtains
    the path of this directory, but it is searched.  The name of this
    directory is System.
</li><li>
    The Windows directory.  Use the <a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a>
    function to get the path of this directory.
</li><li>
    The directories that are listed in the PATH environment variable.
</li></ol>
</p>
<p>
    To revert to the default search path used by <a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a> and
<strong>LoadLibraryEx</strong>, call <strong>SetDllDirectory</strong> with NULL.
</p>
</div>
  <h5 id="CADability_Kernel_SetDllDirectory_System_String__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetDllDirectory_System_Int32_System_Text_StringBuilder_">GetDllDirectory(Int32, StringBuilder)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetSystemDirectory_System_Text_StringBuilder_System_Int32_">GetSystemDirectory(StringBuilder, Int32)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetWindowsDirectory_System_Text_StringBuilder_System_Int32_">GetWindowsDirectory(StringBuilder, Int32)</a></div>
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_LoadLibrary_System_String_">LoadLibrary(String)</a></div>
  </div>
  
  
  <a id="CADability_Kernel_SetProcessWorkingSetSize_" data-uid="CADability.Kernel.SetProcessWorkingSetSize*"></a>
  <h4 id="CADability_Kernel_SetProcessWorkingSetSize_System_IntPtr_System_Int32_System_Int32_" data-uid="CADability.Kernel.SetProcessWorkingSetSize(System.IntPtr,System.Int32,System.Int32)">SetProcessWorkingSetSize(IntPtr, Int32, Int32)</h4>
  <div class="markdown level1 summary"><p>The <strong>SetProcessWorkingSetSize</strong> function sets the minimum and maximum working
set sizes for the specified process.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.IntPtr</span></td>
        <td><span class="parametername">process</span></td>
        <td><p>
    Handle to the process whose working set sizes is to be set.
</p>
<p>
    The handle must have the PROCESS_SET_QUOTA access right.
</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">minimumWorkingSetSize</span></td>
        <td><p>
    Minimum working set size for the process, in bytes.  The virtual memory
    manager attempts to keep at least this much memory resident in the
    process whenever the process is active.
</p>
<p>
    If both <em>minimumWorkingSetSize</em> and <em>maximumWorkingSetSize</em> have the
    value -1, the function temporarily trims the working set of the specified
    process to zero.  This essentially swaps the process out of physical RAM
    memory.
</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><span class="parametername">maximumWorkingSetSize</span></td>
        <td><p>
    Maximum working set size for the process, in bytes.  The virtual memory
    manager attempts to keep no more than this much memory resident in the
    process whenever the process is active and memory is in short supply.
</p>
<p>
    If both <em>minimumWorkingSetSize</em> and <em>maximumWorkingSetSize</em> have the
    value -1, the function temporarily trims the working set of the specified
    process to zero.  This essentially swaps the process out of physical RAM
    memory.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>
    If the function succeeds, the return value is true.
</p>
<p>
    If the function fails, the return value is false.  To get extended error
    information, call <span class="xref">System.Runtime.InteropServices.Marshal.GetLastWin32Error</span>.
</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CADability_Kernel_SetProcessWorkingSetSize_System_IntPtr_System_Int32_System_Int32__remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>
    The working set of a process is the set of memory pages currently visible to
    the process in physical RAM memory.  These pages are resident and available
    for an application to use without triggering a page fault.  The minimum and
    maximum working set sizes affect the virtual memory paging behavior of a
    process.
</p>
<p>
    The working set of the specified process can be emptied by specifying the
    value -1 for both the minimum and maximum working set sizes.
</p>
<p>
    If the values of either <em>minimumWorkingSetSize</em> or
<em>maximumWorkingSetSize</em> are greater than the process&apos; current working
set sizes, the specified process must have the SE_INC_BASE_PRIORITY_NAME
privilege.  Users in the Administrators and Power Users groups generally
have this privilege.
</p>
<p>
    The operating system allocates working set sizes on a first-come,
    first-served basis.  For example, if an application successfully sets 40
    megabytes as its minimum working set size on a 64-megabyte system, and a
    second application requests a 40-megabyte working set size, the operating
    system denies the second application&apos;s request.
</p>
<p>
    Using the <strong>SetProcessWorkingSetSize</strong> function to set an application&apos;s
    minimum and maximum working set sizes does not guarantee that the requested
    memory will be reserved, or that it will remain resident at all times.  When
    the application is idle, or a low-memory situation causes a demand for memory,
    the operating system can reduce the application&apos;s working set.  An application
    can use the <strong>VirtualLock</strong> function to lock ranges of the application&apos;s
    virtual address space in memory; however, that can potentially degrade the
    performance of the system.
</p>
<p>
    When you increase the working set size of an application, you are taking away
    physical memory from the rest of the system.  This can degrade the performance
    of other applications and the system as a whole.  It can also lead to failures
    of operations that require physical memory to be present; for example,
    creating processes, threads, and kernel pool.  Thus, you must use the
<strong>SetProcessWorkingSetSize</strong> function carefully.  You must always consider
the performance of the whole system when you are designing an application.
</p>
</div>
  <h5 id="CADability_Kernel_SetProcessWorkingSetSize_System_IntPtr_System_Int32_System_Int32__seealso">See Also</h5>
  <div class="seealso">
      <div><a class="xref" href="CADability.Kernel.html#CADability_Kernel_GetProcessWorkingSetSize_System_IntPtr_System_Int32__System_Int32__">GetProcessWorkingSetSize(IntPtr, out Int32, out Int32)</a></div>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=CADability_Kernel.md&amp;value=---%0Auid%3A%20CADability.Kernel%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
                  </li>
                  <li>
                    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/OpenGL.cs/#L16" class="contribution-link">View Source</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>In This Article</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
